using Game.Main.Model;
using SimpleJSON;
using UnityEngine;

namespace Game.Component
{
	public class FeederItem : CupItem
	{
		public override void Init(ItemArchiveData data)
		{
			base.Init(data);
		}

		protected override void InitWater(ItemArchiveData data)
		{
			waterSprite = model.Find("WaterFill").GetComponent<SpriteRenderer>();
			float num = waterSprite.sprite.texture.height;
			Rect textureRect = waterSprite.sprite.textureRect;
			float num2 = textureRect.yMin / num;
			float value = textureRect.yMax / num - num2;
			waterSprite.material.SetFloat("_StartY", num2);
			waterSprite.material.SetFloat("_TotalY", value);
			SetFillAmount(data.floatParam1 + 1f);
			needMixColor = false;
		}

		protected override void PackDetailData(JSONObject obj)
		{
			obj["62"] = fillAmount - 1f;
		}
	}
}
